<include file="Public/header" />
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>积分商城</h3>
      <ul class="tab-base">
        <li><a href="{:U('Gift/gift_manage')}" class=""><span>礼品管理</span></a></li>
        <li><a href="{:U('Gift/gift_add')}" class=""><span>新增礼品</span></a></li>
        <li><a href="javascript:void(0);" class="current"><span>订单管理</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form method="get" name="formSearch">
    <table class="tb-type1 noborder search">
      <tbody>
        <tr>
          <th>会员名称</th>
          <td><input type="text" value="{$search['member_name']}" name="member_name" class="txt" ></td>
          <td>
			  <select name='go_state'>
				<option value="" <if condition="$search['go_state'] eq ''">selected</if>>全部订单</option>
				<option value="1" <if condition="$search['go_state'] eq 1">selected</if>>已下单</option>
				<option value="2" <if condition="$search['go_state'] eq 2">selected</if>>已发货</option>
				<option value="3" <if condition="$search['go_state'] eq 3">selected</if>>已收货</option>
			  </select>
          </td>
          <td><a href="javascript:document.formSearch.submit();" class="btn-search tooltip" title="查询">&nbsp;</a></td>
        </tr>
      </tbody>
    </table>
  </form>
  <!-- 操作说明 -->
  <table class="table tb-type2" id="prompt">
    <tbody>
      <tr class="space odd">
        <th colspan="12" class="nobg"><div class="title">
            <h5><操作提示</h5>
            <span class="arrow"></span></div></th>
      </tr>
      <tr>
        <td>
        	<ul>
            	<li>在这里可以看到会员兑换礼品的详细日志记录信息</li>
          	</ul>
        </td>
      </tr>
    </tbody>
  </table>
  <form id="list_form" method='post'>
    <table class="table tb-type2">
      <thead>
        <tr class="space">
          <th colspan="15" class="nobg">列表</th>
        </tr>
        <tr class="thead">
          <th class="w200">会员名</th>
          <th>礼品名称</th>
          <th class="w132">礼品积分</th>
		  <th class="w132">兑换数量</th>
		  <th class="w132">总积分</th>
		  <th class="w132">下单时间</th>
		  <th class="w132">最后状态变更</th>
		  <th class="w84">订单状态</th>
		  <th class="w120 align-center">操作</th>
        </tr>
      </thead>
      <tbody>
        <notempty name="list">
        <volist name="list" id="val">
        <tr class="hover edit">
          <td>{$val['member_name']}</td>
		  <td>{$val['sg_name']}</td>
		  <td>{$val['go_unit_point']}</td>
		  <td>{$val['go_num']}</td>
		  <td>{$val['go_total_point']}</td>
		  <td>{$val['go_add_time']|date='Y-m-d H:i:s',###}</td>
		  <td>{$val['go_change_time']|date='Y-m-d H:i:s',###}</td>
		  <td>
          <if condition="$val['go_state'] eq 1">已下单
          <elseif condition="$val['go_state'] eq 2"/>已发货
          <else/>已收货
          </if>
          </td>
		  <td class='align-center'><a href="{:U('Gift/order_detail',array('go_id'=>$val['go_id']))}" >查看订单</a>
		  <if condition="$val['go_state'] eq 1">
		  &nbsp;|&nbsp;<a href='javascript:if(confirm("确认发货吗？"))window.location="{:U('Gift/order_ship',array('go_id'=>$val['go_id']))}";' >确认发货</a>
		  </if>
		  </td>
        </tr>
        </volist>
        <else /> 
        <tr class="no_data">
          <td colspan="10">暂无记录</td>
        </tr>
        </notempty>
      </tbody>
      <notempty name="list">
      <tfoot>
        <tr class="tfoot">
          <td id="batchAction" colspan="15">
            <div class="pagination">{$show_page}</div>
          </td>
        </tr>
      </tfoot>
     </notempty> 
    </table>
  </form>
</div>
<include file="Public/footer" />